//
//  GameMaster.cpp
//  DiceWar
//
//  Created by xiaofeng on 27/6/12.
//  Copyright (c) 2012 __MyCompanyName__. All rights reserved.
//

#include "GameMaster.h"

GameMaster::GameMaster()
: m_gameMode(kPeopleVsPeople)
, m_numPlayers(3)
, m_maxNumPlayers(4)
, m_humanType(kRedPlayer) {}

GameMaster::~GameMaster() {}

GameMaster& GameMaster::instance()
{
    static GameMaster instance;
    return instance;
}

bool GameMaster::init()
{
    m_hexMap.generate(m_numPlayers);
    return true;
}

void GameMaster::generateNextMap()
{
    m_hexMap.generate(m_numPlayers);
}

void GameMaster::setNumPlayers(int numPlayers)
{
    CCAssert(numPlayers >= 2 && numPlayers <= kInvalidPlayer, "Invalid Player number");
    m_numPlayers = numPlayers;
}

void GameMaster::setGameMode(GameMode gameMode)
{
    CCAssert(kInvalidMode != gameMode, "Invalid Game Mode!");
    m_gameMode = gameMode;
}

void GameMaster::setHumanPlayerType(PlayerType type)
{
    CCAssert(kInvalidPlayer != type, "Invalide Player Type for Human Player");
    m_humanType = type;
}
